package com.open.capacity.user.controller;

import com.open.capacity.commons.PageResult;
import com.open.capacity.model.log.SysLog;
import com.open.capacity.user.service.SysLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author 作者 ftquan E-mail: 464725602@qq.com
 * @version 创建时间：2017年11月12日 上午22:57:51
 * 日志
 */
@RestController
@Api(tags = "操作日志api")
public class SysLogController {

    private static Logger logger = LoggerFactory.getLogger(SysLogController.class);


    @Autowired
    private SysLogService logService;


    @PreAuthorize("hasAuthority('log:get/logs')")
    @ApiOperation(value = "查询日志")
    @GetMapping("/logs/list")
    public PageResult<SysLog> findLogs(@RequestParam Map<String, Object> params) {
        PageResult<SysLog> pageResult = logService.pageAll(params);
        return pageResult;
    }


}
